An extremely useful software debugging tool is the breakpoint function. The breakpoint function forces program execution to terminate at a specific program address, at which point various registers and memory locations may be examined.
A breakpoint is accomplished by comparing processor generated addresses with a predetermined address. When a generated address matches a predetermined address, a breakpoint occurs. The operation of the computer is then interrupted to permit analysis.
One known method for implementing the breakpoint function is to modify the software (i.e., computer program) itself. At certain addresses in the software, a software "trap" could be provided. This method is relatively inexpensive, however, a serious disadvantage is that software must be modified. Software modification typically requires re-compilation or re-assembly of the code on a development system, followed by a new download into the memory of the target system. This takes a considerable amount of time. Worse yet, the code may be stored in non-writable memory (e.g., PROM or ROM) which requires replacement to effect a software change.
In another method, hardware external to the computer or microprocessor is used for breakpoint interrupts. This external hardware monitors the address stream generated by the processor as instructions are being fetched from memory, and compares each address to pre-determined breakpoint addresses. A breakpoint is generated upon finding a match. While this method has the advantage of not requiring changes to the software, it has several disadvantages.
The external hardware method generally requires expensive hardware and a significant amount of circuit board space. Further, for high speed processors, the system may not react quick enough to provide "real time" breakpoints. Additionally, for processors with memory management units (for address translation) on the microprocessor chip itself, the user may not have access to the virtual memory addresses. It is frequently not as useful to set breakpoints on physical addresses (as opposed to logical addresses). Thus, to access logical addresses, the breakpoint hardware must often be designed into the chip itself.